<template>
  <view class="login-page">
 
    <view class="bg-logo"> </view>
    <view class="bg-bottom"> </view>

    <view class="login-layout">
      <view class="login-box">
        <view class="title">Hi,欢迎登录旅游平台</view>
        <view class="login-input">
          <text class="iconfont start-icon icon-weibiaoti--6"></text>
          <input
            class="uni-input"
            placeholder="请输入账号"
            v-model="username"
            placeholder-class="placeholder-style"
          />
          <text
            class="iconfont end-icon icon-weibiaoti--13"
            @click="clearUsername"
          ></text>
        </view>
        <view class="login-input">
          <text class="iconfont start-icon icon-weibiaoti--27"></text>
          <input
            class="uni-input"
            placeholder="请输入密码"
            :password="showPassword"
            v-model="password"
            placeholder-class="placeholder-style"
          />
          <text
            class="iconfont end-icon icon-weibiaoti--34"
            @click="showPassword = !showPassword"
          ></text>
        </view>
      </view>
      <view class="radio-box">
        <label class="radio"
          ><radio
            :checked="checked"
            @click="checked = !checked"
            activeBackgroundColor="#4caa84"
          />
          <text>我已同意并阅读</text>
          <text class="user-terms">《用户条款和相关服务协议》</text>
        </label>
      </view>
      <view class="login-button" @click="loginFn">登录</view>
      <view class="other-login">
        <view class="icon-text">
          <hr />
          <text>其他登录方式</text>
          <hr />
        </view>
        <view class="login-icon">
          <view class="icon-image">
            <image src="/static/icon/qq.png"></image>
          </view>
          <view class="icon-image">
            <image src="/static/icon/weixin.png"></image>
          </view>
          <view class="icon-image">
            <image src="/static/icon/shouji.png"></image>
          </view>
        </view>
      </view>
      <view class="login-bottom">
        <text class="bottom-text">忘记密码</text>
        <text class="bottom-text">注册账号</text>
      </view>
    </view>
  </view>
</template>

<script>
import { defineComponent, ref } from "vue";
import { useMixin } from "./mixins";
export default defineComponent({
  name: "login003",
  props: {},
  components: {},
  setup() {
    const checked = ref(false);
    const mixin = useMixin();
    return {
      checked,
      ...mixin,
    };
  },
});
</script>

<style lang="less" scoped>
.login-page {
  width: 100%;
  height: 100vh;
  background: #ffffff;
  overflow: hidden;
}
.bg-logo {
  background: url("/static/bg/lvyou.jpg");
  background-size: cover;
  background-position: 0rpx -170rpx;
  padding-top: 80rpx;
  box-sizing: border-box;
  height: 700rpx;
}
.bg-bottom {
  position: absolute;
  top: 630rpx;
  left: 50%;
  transform: translateX(-50%);
  width: 1600rpx;
  height: 1000rpx;
  border-radius: 50%;
  background: #fff;
}
.login-layout {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 260rpx;
  .login-box {
    width: 600rpx;
    position: absolute;
    top: -80rpx;
    border-radius: 8rpx;
    box-shadow: 0 6rpx 17rpx 1rpx rgba(119, 119, 119, 0.2);
    background: #fff;
    padding: 0 40rpx;
    box-sizing: border-box;
    .title {
      font-size: 38rpx;
      color: #4caa84;
      font-weight: 700;
      height: 80rpx;
      line-height: 80rpx;
      text-align: center;
      width: 100%;
    }
    .login-input {
      position: relative;
      .uni-input {
        border-bottom: 1rpx solid #eeeeee;
        height: 120rpx;
        line-height: 120rpx;
        padding: 0 60rpx;
        box-sizing: border-box;
        //   placeholder样式修改
        .placeholder-style {
          color: #999;
          font-size: 24rpx;
        }
      }
      .start-icon {
        font-size: 40rpx;
        position: absolute;
        left: 0;
        color: #4caa84;
        top: 50%;
        transform: translateY(-50%);
      }
      .end-icon {
        font-size: 30rpx;
        position: absolute;
        color: #999;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
      }
    }
  }
  /deep/ .uni-radio-input {
    width: 20rpx !important;
    height: 20rpx !important;
  }
  .radio-box {
    width: 100%;
    margin-top: 20rpx;
    .radio {
      font-size: 18rpx;
      .user-terms {
        color: #0077ff;
      }
    }
  }

  // 登录按钮
  .login-button {
    width: 600rpx;
    background: #4caa84;
    height: 100rpx;
    line-height: 100rpx;
    text-align: center;
    border-radius: 8rpx;
    color: #fff;
    font-size: 30rpx;
    margin-top: 50rpx;
    transition: all 0.3s;
    &:active {
      background: #3c9c7c;
    }
  }
  // 忘记密码
  .login-bottom {
    width: 580rpx;
    display: flex;
    justify-content: center;
    margin-top: 50rpx;
    .bottom-text {
      color: #3c9c7c;
      font-size: 24rpx;
      margin: 0 10rpx;
      &:active {
        color: #3c9c7c;
      }
    }
  }
  // 其他登录方式
  .other-login {
    width: 400rpx;
    box-sizing: border-box;
    margin-top: 80rpx;
    .icon-text {
      display: flex;
      align-items: center;
      justify-content: space-between;
      color: #4caa84;
      padding: 0 10rpx;
      box-sizing: border-box;
      hr {
        height: 0.5rpx;
        width: 80rpx;
        margin: 0;
        padding: 0;
      }
      // 横向
    }
    .login-icon {
      margin-top: 50rpx;
      display: flex;
      justify-content: space-between;
      .icon-image {
        width: 50rpx;
        height: 50rpx;
        padding: 10rpx;
        background: #fff;
        border-radius: 50%;
        border: 2rpx solid #4caa84;
        image {
          width: 100%;
          height: 100%;
        }
      }
    }
  }
}
</style>
